Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to k4run #93

Merged
merged 7 commits into from
Apr 17, 2023
Merged

Improvements to k4run #93

merged 7 commits into from
Apr 17, 2023

Conversation

jmcarcell
Copy link
Contributor

@jmcarcell jmcarcell commented Jan 12, 2023

BEGINRELEASENOTES

  • Add improvements to k4run: clean up code, use the logging module, parse all the arguments using argparse, sort display of options

ENDRELEASENOTES

  • Parsing is done using argparse only instead of the previous combination of manual parsing and argparse. I think this is cleaner and if the arguments are wrong it will show the usage automatically (before there was a explicit testing of this)
  • Code was cleaned up a bit, for example there were very deeply nested if/for that can be changed a bit. Indentation is (and was) inconsistent so if we agree on 2 or 4 spaces I can change that; it makes the diff very hard to read so we can keep it for the last change.
  • Previously the display of options wouldn't be sorted and would be different each time because there was a list(set( that has undetermined ordering, now it will always be sorted in the same order as they were defined in the file (for python >= 3.7, since it is a one liner in that case).
  • Now using logging for messages as per Use python logger instead of print() in k4Run #50. Right now there is a [k4run] for the messages that come from k4run but this is a placeholder. For example for the Gaudi processes the format looks like [ MESSAGE "VXDEndcapDigitiser"] and many things can be done like adding the date, the level of the message, etc. I don't have a strong opinion. This is how it looks now:
[k4run] LcioEvent --> MyAIDAProcessor --> EventNumber --> InitDD4hep --> Config --> OverlayFalse --> VXDBarrelDigitiser --> VXDEndcapDigitiser --> InnerPlanarDigiProcessor --> InnerEndcapPlanarDigiProcessor --> OuterPlanarDigiProcessor --> OuterEndcapPlanarDigiProcessor --> MyConformalTracking --> ClonesAndSplitTracksFinder --> Refit --> MyDDCaloDigi --> MyDDSimpleMuonDigi --> MyDDMarlinPandora --> LumiCalReco --> MergeRP --> MergeClusters --> MyClicEfficiencyCalculator --> MyRecoMCTruthLinker --> MyTrackChecker --> CLICPfoSelectorDefault_HE --> CLICPfoSelectorLoose_HE --> CLICPfoSelectorTight_HE --> CLICPfoSelectorDefault_LE --> CLICPfoSelectorLoose_LE --> CLICPfoSelectorTight_LE --> RenameCollection --> VertexFinder --> JetClusteringAndRefiner --> Output_REC --> Output_DST
[k4run] Option name: EventDataSvc.OutputLevel EventDataSvc.OutputLevel 0
[k4run] Option name: LcioEvent.OutputLevel LcioEvent.OutputLevel 4
[k4run] Option name: LcioEvent.Files LcioEvent.Files ['ttbar.slcio']
[k4run] Option name: InitDD4hep.OutputLevel InitDD4hep.OutputLevel 4
[k4run] Option name: InitDD4hep.ProcessorType InitDD4hep.ProcessorType InitializeDD4hep

I ran clicReconstruction.py on the same file and got similar results

Other related issues:

  File "/cvmfs/sw.hsf.org/spackages6/gaudi/36.5/x86_64-centos7-gcc11.2.0-opt/z2prd/python/Gaudi/Main.py", line 476, in run
    result = self.runParallel(ncpus)
  File "/cvmfs/sw.hsf.org/spackages6/gaudi/36.5/x86_64-centos7-gcc11.2.0-opt/z2prd/python/Gaudi/Main.py", line 561, in runParallel
    Parall = gpp.Coord(ncpus, c, self.log)
  File "/cvmfs/sw.hsf.org/spackages6/gaudi/36.5/x86_64-centos7-gcc11.2.0-opt/z2prd/python/GaudiMP/GMPBase.py", line 1378, in __init__
    sub = Subworker(
  File "/cvmfs/sw.hsf.org/spackages6/gaudi/36.5/x86_64-centos7-gcc11.2.0-opt/z2prd/python/GaudiMP/GMPBase.py", line 834, in __init__
    GMPComponent.__init__(
  File "/cvmfs/sw.hsf.org/spackages6/gaudi/36.5/x86_64-centos7-gcc11.2.0-opt/z2prd/python/GaudiMP/GMPBase.py", line 473, in __init__
    self.msgFormat = self.config["MessageSvc"].Format
KeyError: 'MessageSvc'

k4FWCore/scripts/k4run Outdated Show resolved Hide resolved
@vvolkl
Copy link
Contributor

vvolkl commented Jan 12, 2023

See my comment on the commit: 59b0c68 .

The

[k4run] Option name: EventDataSvc.OutputLevel EventDataSvc.OutputLevel 0
[k4run] Option name: LcioEvent.OutputLevel LcioEvent.OutputLevel 4
[k4run] Option name: LcioEvent.Files LcioEvent.Files ['ttbar.slcio']
[k4run] Option name: InitDD4hep.OutputLevel InitDD4hep.OutputLevel 4
[k4run] Option name: InitDD4hep.ProcessorType InitDD4hep.ProcessorType InitializeDD4hep

logging was added for some ad-hoc debugging, in principle this information is stored in the metadata by the joboptions service. It could be removed, but maybe it is nice to have in the logs.

k4FWCore/scripts/k4run Outdated Show resolved Hide resolved
k4FWCore/scripts/k4run Outdated Show resolved Hide resolved
k4FWCore/scripts/k4run Outdated Show resolved Hide resolved
k4FWCore/scripts/k4run Outdated Show resolved Hide resolved
k4FWCore/scripts/k4run Outdated Show resolved Hide resolved
k4FWCore/scripts/k4run Outdated Show resolved Hide resolved
k4FWCore/scripts/k4run Outdated Show resolved Hide resolved
Co-authored-by: Andre Sailer <andre.philippe.sailer@cern.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants